import { IVec3Like } from 'cc';

export type Surface = {
	position: IVec3Like;
	rotation: IVec3Like;
	active: boolean;
	scale?: IVec3Like;
	children: SurfaceNode[];
};
export type SurfaceNode = { surface: Surface };
export const levelData: Array<SurfaceNode> = [
	// 第1关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			active: false,
			children: [
				// 上1
				{
					surface: {
						position: {
							x: 0,
							y: 1,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 0,
						},
						active: true,
						children: [],
					},
				},
				// 右1
				{
					surface: {
						position: {
							x: 1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: -90,
						},
						active: true,
						children: [
							//右2
							{
								surface: {
									position: {
										x: 0,
										y: 1,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 0,
									},
									active: true,
									children: [],
								},
							},
						],
					},
				},
				// 下1
				{
					surface: {
						position: {
							x: 0,
							y: -1,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: -180,
						},
						active: true,
						children: [],
					},
				},
				//左1
				{
					surface: {
						position: {
							x: -1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 90,
						},
						active: true,
						children: [],
					},
				},
			],
		},
	},
	// 第2关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			active: false,
			children: [
				// 右1
				{
					surface: {
						position: {
							x: 1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: -90,
						},
						active: true,
						children: [
							//下1
							{
								surface: {
									position: {
										x: 1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: -90,
									},
									active: true,
									children: [],
								},
							},
						],
					},
				},
				//左1
				{
					surface: {
						position: {
							x: -1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 90,
						},
						active: true,
						children: [
							// 左
							{
								surface: {
									position: {
										x: 0,
										y: 1,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 0,
									},
									active: true,
									children: [
										{
											surface: {
												position: {
													x: 1,
													y: 0,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: -90,
												},
												active: true,
												children: [],
											},
										},
									],
								},
							},
						],
					},
				},
			],
		},
	},
	// 第3关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			active: false,
			children: [
				//左1
				{
					surface: {
						position: {
							x: -1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 90,
						},
						active: true,
						children: [
							// 左2
							{
								surface: {
									position: {
										x: 0,
										y: 1,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 0,
									},
									active: true,
									children: [
										//上
										{
											surface: {
												position: {
													x: 1,
													y: 0,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: -90,
												},
												active: true,
												children: [],
											},
										},
										//左
										{
											surface: {
												position: {
													x: 0,
													y: 1,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: 0,
												},
												active: true,
												children: [],
											},
										},
										//下
										{
											surface: {
												position: {
													x: -1,
													y: 0,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: 90,
												},
												active: true,
												children: [],
											},
										},
									],
								},
							},
						],
					},
				},
			],
		},
	},
	// 第4关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			active: false,
			children: [
				//左1
				{
					surface: {
						position: {
							x: -1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 90,
						},
						active: true,
						children: [
							// 下
							{
								surface: {
									position: {
										x: -1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 90,
									},
									active: true,
									children: [],
								},
							},
							// 上
							{
								surface: {
									position: {
										x: 1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: -90,
									},
									active: true,
									children: [
										//左
										{
											surface: {
												position: {
													x: -1,
													y: 0,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: 90,
												},
												active: true,
												children: [],
											},
										},
									],
								},
							},
						],
					},
				},
				// 右1
				{
					surface: {
						position: {
							x: 1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: -90,
						},
						active: true,
						children: [],
					},
				},
			],
		},
	},
	// 第5关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			active: false,
			children: [
				//左1
				{
					surface: {
						position: {
							x: -1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 90,
						},
						active: true,
						children: [],
					},
				},
				//下1
				{
					surface: {
						position: {
							x: 0,
							y: -1,
							z: 0,
						},
						rotation: {
							x: 180,
							y: 180,
							z: 0,
						},
						active: true,
						children: [
							// 右
							{
								surface: {
									position: {
										x: -1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 90,
									},
									active: true,
									children: [
										//下
										{
											surface: {
												position: {
													x: 1,
													y: 0,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: -90,
												},
												active: true,
												children: [],
											},
										},
										//右
										{
											surface: {
												position: {
													x: 0,
													y: 1,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: 0,
												},
												active: true,
												children: [],
											},
										},
									],
								},
							},
						],
					},
				},
			],
		},
	},
	// 第6关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			active: false,
			children: [
				//左1
				{
					surface: {
						position: {
							x: -1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 90,
						},
						active: true,
						children: [
							// 上
							{
								surface: {
									position: {
										x: 1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: -90,
									},
									active: true,
									children: [
										//左
										{
											surface: {
												position: {
													x: -1,
													y: 0,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: 90,
												},
												active: true,
												children: [],
											},
										},
									],
								},
							},
						],
					},
				},
				// 右1
				{
					surface: {
						position: {
							x: 1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: -90,
						},
						active: true,
						children: [
							//下
							{
								surface: {
									position: {
										x: 1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: -90,
									},
									active: true,
									children: [],
								},
							},
						],
					},
				},
			],
		},
	},
	// 第7关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			active: false,
			children: [
				//上1
				{
					surface: {
						position: {
							x: 0,
							y: 1,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 0,
						},
						active: true,
						children: [
							//左
							{
								surface: {
									position: {
										x: -1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 90,
									},
									active: true,
									children: [],
								},
							},
						],
					},
				},
				// 右1
				{
					surface: {
						position: {
							x: 1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: -90,
						},
						active: true,
						children: [
							//下
							{
								surface: {
									position: {
										x: 1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: -90,
									},
									active: true,
									children: [
										//右
										{
											surface: {
												position: {
													x: -1,
													y: 0,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: 90,
												},
												active: true,
												children: [],
											},
										},
									],
								},
							},
						],
					},
				},
			],
		},
	},
	// 第8关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			active: false,
			children: [
				//左1
				{
					surface: {
						position: {
							x: -1,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 90,
						},
						active: true,
						children: [
							//左
							{
								surface: {
									position: {
										x: 0,
										y: 1,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 0,
									},
									active: true,
									children: [],
								},
							},
						],
					},
				},
				// 下1
				{
					surface: {
						position: {
							x: 0,
							y: -1,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 180,
						},
						active: true,
						children: [
							//右
							{
								surface: {
									position: {
										x: -1,
										y: 0,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 90,
									},
									active: true,
									children: [
										//右
										{
											surface: {
												position: {
													x: 0,
													y: 1,
													z: 0,
												},
												rotation: {
													x: 0,
													y: 0,
													z: 0,
												},
												active: true,
												children: [],
											},
										},
									],
								},
							},
						],
					},
				},
			],
		},
	},
	// 第9关
	{
		// 静态框
		surface: {
			position: {
				x: 0,
				y: 0.25,
				z: 0,
			},
			rotation: {
				x: -90,
				y: 0,
				z: 0,
			},
			scale: {
				x: 1,
				y: 1,
				z: 1,
			},
			active: false,
			children: [
				//左1
				{
					surface: {
						position: {
							x: -0.725,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 90,
						},
						scale: {
							x: 1,
							y: 0.5,
							z: 1,
						},
						active: true,
						children: [],
					},
				},
				//上1
				{
					surface: {
						position: {
							x: 0,
							y: 0.725,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 0,
						},
						scale: {
							x: 1,
							y: 0.5,
							z: 1,
						},
						active: true,
						children: [],
					},
				},
				//右1
				{
					surface: {
						position: {
							x: 0.725,
							y: 0,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: -90,
						},
						scale: {
							x: 1,
							y: 0.5,
							z: 1,
						},
						active: true,
						children: [
							{
								surface: {
									position: {
										x: 0,
										y: 1.5,
										z: 0,
									},
									rotation: {
										x: 0,
										y: 0,
										z: 0,
									},
									scale: {
										x: 1,
										y: 2,
										z: 1,
									},
									active: true,
									children: [],
								},
							},
						],
					},
				},
				// 下1
				{
					surface: {
						position: {
							x: 0,
							y: -0.725,
							z: 0,
						},
						rotation: {
							x: 0,
							y: 0,
							z: 180,
						},
						scale: {
							x: 1,
							y: 0.5,
							z: 1,
						},
						active: true,
						children: [],
					},
				},
			],
		},
	},
];
